package dfbz.homework1;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;

public class Test02 {
    public static void main(String[] args) {
        HashMap<Object, Object> map = new HashMap<>();
        map.put("黄晓明","杨颖");
        map.put("刘恺威","杨幂");
        map.put("abay","a1");//无序
        map.put("baby2","a2");
        Set<Object> objects = map.keySet();
        for (Object object : objects) {
            System.out.println(object);
        }
        Iterator<Object> iterator = objects.iterator();
        while (iterator.hasNext()){
            Object next = iterator.next();
            System.out.println(next);
        }
    }
}
